# dic = {'python': 95,  'java': 99,    'c': 100}
# 一.有如上字典内容用程序解答下面的题目
#
# 1. 字典的长度是多少
#
# 2. 请修改'java' 这个key对应的value值为98
#
# 3. 删除 c 这个key
#
# 4. 增加一个key-value对，key值为 php, value是90
#
# 5. 获取所有的key值，存储在列表里
#
# 6. 获取所有的value值，存储在列表里
#
# 7. 判断 javascript 是否在字典中
#
# 8. 获得字典里所有value 的和
#
# 9. 获取字典里最大的value
#
# 10. 获取字典里最小的value
#
# 11. 字典 dic1 = {'php': 97}， 将dic1的数据更新到dic中
#
# 12.获得新字典,要求:获得分数100的key大写
dic = {'python':95,'java':99,'c':100}
print(f'长度是:{len(dic)}')
dic['java'] = 98
print(dic)
del dic['c']
print(dic)
dic.update({'php':90})
print(dic)
print(f'获取所有的key值:{dic.keys()}')
print(f'获取所有的value值:{dic.values()}')
# 'javascript' in dic.keys()
print('javascript' in dic)
print(sum(dic.values()))
print(max(dic.values()))
print(min(dic.values()))
dic1 = {'php':97}
dic.update(dic1)
print(dic)
dic['c'] = 100


# 获得新字典,要求:获得分数100的key大写
dic['c'] = 100

num = ''
littler = ''

# print(dic)
# for item in dic.keys():
#     if dic[item] == 100:
#         print("__________________", item)
#         num = item.upper()
#         littler = item

print(dic)
# del dic[littler]
# dic[num] = 100
#
#
# print(dic)

for i in dic.keys():
    if dic[i] == 100:
        # print(i)
        max_1 = i.upper()
        print(max_1)

dic[max_1] = 100
print(dic)
# dic['C'] =100
del dic['c']